﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Fis.Service.Rules
{
    public class LoginViewProvider : Agile.Engine.View.ProxyViewProvider
    {
        public override System.Collections.Hashtable InitializeViewModel(System.Collections.Hashtable args)
        {
            return new System.Collections.Hashtable();
        }



        public override bool ExecuteValidate(System.Collections.Hashtable args)
        {
            var execute = InvokeService(args);
            if (execute)
            {
                ///成功写入全局缓存
                var data = Agile.Engine.Utils.ZipUtils.UnZipDataTable(ServiceProcess.Result["data"].ToString());
                Fis.Win.Utils.AppSession.UserInfo = Agile.Engine.Utils.DataUtils.ToHashTable(data.Rows[0]);
            }

            View.Message = ServiceProcess.Message;

            return execute;
        }
    }
}
